package com.gg.hc.controller;

import com.gg.common.pojo.DModuleDetails;
import com.gg.common.pojo.DesignModule;
import com.gg.common.pojo.MDesignProcedureModule;
import com.gg.hc.service.DModuleDetailsService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class DModuleDetailsController {

    @Resource
    private DModuleDetailsService dModuleDetailsService;

    @ResponseBody
    @RequestMapping("/queryByParentId.action")
    public List<DesignModule> queryByParentId(Integer id){
        System.out.println("进来了");
        return dModuleDetailsService.queryByParentId(id);
    }
    @ResponseBody
    @RequestMapping("/updateDModuleDetails.action")
    public int updateDModuleDetails(@RequestBody List<DModuleDetails> designModules){
        return dModuleDetailsService.updateDModuleDetails(designModules);
    }
    @ResponseBody
    @RequestMapping("/redesign.action")
    public int redesign(@RequestBody List<DModuleDetails> dModuleDetails){
        return dModuleDetailsService.redesign(dModuleDetails);
    }
    @ResponseBody
    @RequestMapping("/queryDModuleDetailsByParentId.action")
    public List<DModuleDetails> queryDModuleDetailsByParentId(Integer parentId){
        return dModuleDetailsService.queryDModuleDetailsByParentId(parentId);
    }
}
